<?php

namespace App\Console\Commands\Assess;

use App\Services\Common\AmazonComment;
use Illuminate\Console\Command;

class SynAmazonStars extends Command
{
    /**
     * php .\artisan SynAmazonStars --taskId=26706cd5-5227-2f31-a206-87e4f9059218 //同步B07BPQNCPY
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'SynAmazonStars
                            {--taskId=}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '同步八爪鱼抓取的amazon商品得分、评论数、标题';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {

        $taskId = $this->option('taskId');
        $AmazonComment = new AmazonComment();
        $params = [];
        if (!empty($taskId)) $params['task_id'] = $taskId;
        $AmazonComment->getBazhuaYuStars($params);
        exit('SUCCESS');
    }
}



